/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface SoReturnApply extends BasicModel<SoReturnApply> {
  code?: string; // 单据号
  ddate?: string; // 单据日期
  cbustype?: string; // 业务类型
  cstcode?: string; // 销售类型
  cusCode?: string; // 客户编码
  hfdmCode?: string; // 核发店面
  bsp?: string; // 是否首批
  wlComp?: string; // 物流公司
  wlNo?: string; // 物流单号
  zhMoney?: number; // 余额
  cxMoney?: number; // 促销费用余额
  flMoney?: number; // 经销商返利余额
  useFlMoney?: number; // 使用返利金额
  useCxMoney?: number; // 使用促销金额
  auditor?: string; // 审核人
  auditDate?: string; // 审核日期
  auditStatus?: string; // 审核状态
  soReturnApplyRdsList?: any[]; // 子表列表
}

export const soReturnApplyList = (params?: SoReturnApply | any) =>
  defHttp.get<SoReturnApply>({ url: adminPath + '/shop/apply/soReturnApply/list', params });

export const soReturnApplyListData = (params?: SoReturnApply | any) =>
  defHttp.post<Page<SoReturnApply>>({
    url: adminPath + '/shop/apply/soReturnApply/listData',
    params,
  });

export const soReturnApplyForm = (params?: SoReturnApply | any) =>
  defHttp.get<SoReturnApply>({ url: adminPath + '/shop/apply/soReturnApply/form', params });

export const soReturnApplySave = (params?: any, data?: SoReturnApply | any) =>
  defHttp.postJson<SoReturnApply>({
    url: adminPath + '/shop/apply/soReturnApply/save',
    params,
    data,
  });

export const soReturnApplyDelete = (params?: SoReturnApply | any) =>
  defHttp.get<SoReturnApply>({ url: adminPath + '/shop/apply/soReturnApply/delete', params });

export const auditOrder = (params?: any, data?: SoReturnApply | any) =>
  defHttp.postJson<SoReturnApply>({
    url: adminPath + '/shop/apply/soReturnApply/batchSp',
    params,
    data,
  });

export const batchDeSp = (params?: any, data?: SoReturnApply | any) =>
  defHttp.postJson<SoReturnApply>({
    url: adminPath + '/shop/apply/soReturnApply/batchDeSp',
    params,
    data,
  });

export const soReturnApplyExport = (params?: SoReturnApply | any) =>
  defHttp.get<SoReturnApply>({
    url: adminPath + '/shop/apply/soReturnApply/soReturnApplyListDetail',
    params,
  });
